import { configureStore } from "@reduxjs/toolkit"
import authReducer from "./slices/authSlice"
import accessReducer from "./slices/accessSlice"
import appointmentReducer from "./slices/appointmentSlice"
import notificationReducer from "./slices/notificationSlice"
import createAppointmentReducer from "./slices/createAppointmentSlice"
import providerReducer from "./slices/providerSlice"
import loadingSliceReducer from "./slices/loadingSlice"

const store = configureStore({
  reducer: {
    auth: authReducer,
    access: accessReducer,
    provider: providerReducer,
    loading:loadingSliceReducer,
    appointment: appointmentReducer,
    notification: notificationReducer,
    createAppointment: createAppointmentReducer,
  },
})

export default store
// Infer the `RootState` and `AppDispatch` types from the store itself
export type RootState = ReturnType<typeof store.getState>
// Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState}
export type AppDispatch = typeof store.dispatch
